import { useContext } from 'react';
import { ThemeContext } from 'src/context/ThemeContext';
import { useSelector } from 'react-redux';
import { RootState } from 'src/redux/store'
// import IcAuthy from 'src/image/ic-authy.svg';
import IcApp from 'src/image/app-logo.png';
import IcGAuth from 'src/image/ic-gauth.svg';
import style from './Step1.module.scss';

const Step1 = () => {
  const { IcGooglePlay, IcAppStore, IcAndroid, IcIos } = useContext(ThemeContext).image;
  const { baseDataInfo } = useSelector((rootState: RootState) => rootState.basedata);
  return (
    <div>
      <div className={style.heading}>下载</div>
      <div className={style.subHeading}>下载并安装下列 App 之一：</div>
      <div className={style.appBlock}>
        <div className={style.appItems}>
          <div className={style.appHeading}>
            <img src={IcApp} />
            Bitotc
          </div>
          <div className={style.appLinks}>
            <div className={style.linkbox} onClick={() => {
              window.open(baseDataInfo?.FiOSUrl)
            }}>
              <img src={IcIos} alt="" />
              <p>下载iOS App</p>
            </div>
            <div className={style.linkbox} onClick={() => {
              window.open(baseDataInfo?.FAndroidUrl)
            }}>
              <img src={IcAndroid} alt="" />
              <p>下载Android App</p>
            </div>
            {/* <img
              src={IcGooglePlay}
              onClick={() =>
                window.open('https://play.google.com/store/apps/details?id=com.authy.authy')
              }
            /> */}
            {/* <img
              src={IcAppStore}
              onClick={() => window.open('https://apps.apple.com/app/twilio-authy/id494168017')}
            /> */}
          </div>
        </div>
        <div className={style.appItems}>
          <div className={style.appHeading}>
            <img src={IcGAuth} />
            Google Authenticator
          </div>
          <div className={style.appLinks}>
            <img
              src={IcGooglePlay}
              onClick={() =>
                window.open(
                  'https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2',
                )
              }
            />
            <img
              src={IcAppStore}
              onClick={() =>
                window.open('https://apps.apple.com/app/google-authenticator/id388497605')
              }
            />
          </div>
        </div>
      </div>
    </div>
  );
};

export default Step1;
